<template>
  <div class="exception">
    <img :src="getImageUrl(404)" alt="">
    <el-button class="btn-home" @click="goHome">回到上一个页面</el-button>
  </div>
</template>

<script setup lang="js">
import { ref, reactive, toRefs, onMounted} from 'vue'
import { useRouter } from 'vue-router';

const router = useRouter()

const getImageUrl = (img)=>{
    return new URL(`../assets/images/${img}.png`,import.meta.url).href
}

const goHome = ()=>{
    router.go(-2)
}


</script>

<style scoped lang="less">
.exception {
    position: relative;
    img {
        width: 100%;
        height: 100hv;
    }
}
.btn-home {
    position: absolute;
    left: 50%;
    bottom: 100px;
    margin-left: -34px;
}
</style>